package GameMain.View.GameCenter
{
	import Engine.AIUGame.AIGDate;
	import Engine.AIUGame.AIGame;
	import Engine.AIUGame.AIMapBlock;
	
	import GameMain.Game;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	

	public class GameCenter extends AIGame
	{
		private var _player:PlayerModel = null;
		private var _timerID:uint = 0;
		
		public function GameCenter()
		{
			
			super(2000,700);
			
			_player = new PlayerModel();
			
			
			
			var block:AIMapBlock;
			
			for(var i:int = 0;i<10;i++)
			{
				
				if(i%2==0)
				{
					block = new AIMapBlock(i*220,400,200,20);
				}
				else
				{
					block = new AIMapBlock(i*220,500,200,20);
				}
				_movieGroup.add(block);
				
			}
			
			
			_movieGroup.add(_player);
			
			_movieGroup.add(new NPC());
			
			_movieGroup.add(new Bullet());
			
			AIGDate.GameView.follow(_player);
			AIGDate.GameView.setBounds(0,0,2000,700);
			
		}
		
		override protected function update():void
		{
			super.update();
			AIGDate.collide();
		}
		
		public function show(sp:Sprite):void
		{
			sp.addChild(this);
		}
	}
}